/**
 * 如何判断object是否为空
 * */


function isEmptyObject(obj) {

    for (let key in obj) {
        return false
    }
    return true
}

console.log(isEmptyObject({[Symbol('a')]: 1}))


function isEmptyObject2(obj) {
    return Reflect.ownKeys(obj).length === 0
}

console.log(isEmptyObject2({[Symbol('a')]: 1}))

const a = {
    i: 1,
    valueOf: function () {
        return this.i++
    }
}

if (a == 1 && a == 2 && a == 3) {
    console.log('ok')
}

console.log(a == 1 && a == 2 && a == 3)